import sys
import numpy as np
from collections import defaultdict

sumChr = defaultdict(int)
sumCor = defaultdict(int)
for i in sys.stdin:
    if i.startswith('Chr') and 'ChrMT' not in i:
        e = i.split()
        sumChr[e[0]] += int(e[2]) - int(e[1])
        if e[3] != '0':
            sumCor[e[0]] += int(e[2]) - int(e[1])
autosomes = []
chrx = 0
chry = 0
for k, v in sumChr.items():
    coverate = sumCor[k] / v
    if k == 'ChrX':
        chrx = coverate
    elif k == 'ChrY':
        chry = coverate
    else:
        autosomes.append(coverate)
mean = np.mean(autosomes)
median = np.median(autosomes)
sex = 'male'
if mean - 0.05 < chrx or median - 0.05 < chrx:
    sex = 'female'
print(f'{sys.argv[1]}\t{mean:.2%}\t{median:.2%}\t{chrx:.2%}\t{chry:.2%}\t{sex}')